﻿using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace FwProject.ShoppingMall.EventAdvertising
{
    /// <summary>
    /// 商城优惠券
    /// </summary>
    [Table("shop_coupon")]
    public class ShopCoupon: FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 默认0全品1,单类别，使用类别
        /// </summary>
        public CouponType CouponType { get; set; } = CouponType.All;

        /// <summary>
        /// 商品类别Id
        /// </summary>
        public Guid? ProductTypeId { get; set; }
        /// <summary>
        /// 适用范围
        /// </summary>
        public UseCoupon UseCoupon { get; set; } = UseCoupon.Universal;

        /// <summary>
        /// 优惠券金额
        /// </summary>
        public decimal CouponPrice { get; set; } = 0m;

        /// <summary>
        /// 默认0 满减使用
        /// </summary>
        public decimal UsePrice { get; set; } = 0m;

        /// <summary>
        /// 优惠券显示图片
        /// </summary>
        [Required]
        public string CouponPic { get; set; }

        public string CouponNotPic { get; set; }

        /// <summary>
        /// 开始使用时间
        /// </summary>
        public DateTime UseBeginTime { get; set; }

        /// <summary>
        /// 结束使用时间
        /// </summary>
        public DateTime UseEndTime { get; set; }

        /// <summary>
        /// 发行数量
        /// </summary>
        public int CouponCount { get; set; }

        /// <summary>
        /// 优惠券名称
        /// </summary>
        [Required]
        public string CouponTitile { get; set; }

        /// <summary>
        /// 优惠券描述
        /// </summary>
        public string CouponDescribe { get; set; }

    }

    public enum CouponType:byte
    {
        [Display(Name ="全品")]
        All,
        [Display(Name ="单一类别")]
        Single
    }

    public enum UseCoupon : byte
    {
        [Display(Name ="通用")]
        Universal,
        [Display(Name ="满减")]
        FullReduction,
        [Display(Name ="折扣")]
        Discount
    }
}
